﻿using System;
using System.Collections.Generic;

namespace RemotingLibs.QuoteClass
{
    /// <summary>
    /// 实时十档行情
    /// </summary>
    public class QuoteRt
    {
        public string Market { get; set; }
        public string StkCode { get; set; }
        public decimal Vitality { get; set; }
        public decimal LastPrice { get; set; }
        public decimal PreClose { get; set; }
        public decimal Open { get; set; }
        public decimal High { get; set; }
        public decimal Low { get; set; }
        public string Time { get; set; }
        public string VolAll { get; set; }
        public string VolNow { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 内盘
        /// </summary>
        public int invol { get; set; }

        /// <summary>
        /// 外盘
        /// </summary>
        public int outvol { get; set; }

        /// <summary>
        /// 国债利息
        /// </summary>
        /// <summary>
        /// 买1价
        /// </summary>
        public decimal Bid1 { get; set; }

        public decimal Bid2 { get; set; }
        public decimal Bid3 { get; set; }
        public decimal Bid4 { get; set; }
        public decimal Bid5 { get; set; }
        public decimal Bid6 { get; set; }
        public decimal Bid7 { get; set; }
        public decimal Bid8 { get; set; }
        public decimal Bid9 { get; set; }
        public decimal Bid10 { get; set; }

        /// <summary>
        /// 买1量
        /// </summary>
        public int Bsize1 { get; set; }

        public int Bsize2 { get; set; }
        public int Bsize3 { get; set; }
        public int Bsize4 { get; set; }
        public int Bsize5 { get; set; }
        public int Bsize6 { get; set; }
        public int Bsize7 { get; set; }
        public int Bsize8 { get; set; }
        public int Bsize9 { get; set; }
        public int Bsize10 { get; set; }

        /// <summary>
        /// 卖1价
        /// </summary>
        public decimal Ask1 { get; set; }

        public decimal Ask2 { get; set; }
        public decimal Ask3 { get; set; }
        public decimal Ask4 { get; set; }
        public decimal Ask5 { get; set; }
        public decimal Ask6 { get; set; }
        public decimal Ask7 { get; set; }
        public decimal Ask8 { get; set; }
        public decimal Ask9 { get; set; }
        public decimal Ask10 { get; set; }
        public int Asize1 { get; set; }
        public int Asize2 { get; set; }
        public int Asize3 { get; set; }
        public int Asize4 { get; set; }
        public int Asize5 { get; set; }
        public int Asize6 { get; set; }
        public int Asize7 { get; set; }
        public int Asize8 { get; set; }
        public int Asize9 { get; set; }
        public int Asize10 { get; set; }
    }

    /// <summary>
    /// 时间 价格  成交量  成交笔数  方向
    /// </summary>
    public class Transaction
    {
        public string time { get; set; }
        public decimal price { get; set; }
        public int vol { get; set; }
        public int count { get; set; }
        public string direction { get; set; }
    }

    public class MinTimeData
    {
        public decimal price { get; set; }
        public int vol { get; set; }
        public string other { get; set; }
    }

    public class KLineData
    {
        public string stkcode { get; set; }
        public string date { get; set; }
        public decimal open { get; set; }
        public decimal close { get; set; }
        public decimal high { get; set; }
        public decimal low { get; set; }
        public int vol { get; set; }
        public double amount { get; set; }
        public int ucount { get; set; }
        public int dcount { get; set; }
    }

    public class Stkinfo
    {
        public string Stkname { get; set; }
        public int StkBaseVol { get; set; }
        public string StkCode { get; set; }
        public string Type { get; set; }

        /// <summary>
        /// 昨收
        /// </summary>
        public decimal PreClose { get; set; }

        public string Save1 { get; set; }
        public string Save2 { get; set; }
        public string Save3 { get; set; }
    }

    public class RspBsQueue
    {
        /// <summary>
        /// 证券代码
        /// </summary>
        public string StkCode { get; set; }

        public string StockName { get; set; }
        public byte Market { get; set; }
        public decimal Bid { get; set; }
        public decimal Ask { get; set; }
        public int Bidcount { get; set; }
        public int Askcount { get; set; }
        public List<int> BidQueue { get; set; }
        public List<int> AskQueue { get; set; }
        public string ErrorMess { get; set; }
    }

    /// <summary>
    /// 分钟数据
    /// </summary>
    public class StkMin
    {
        /// <summary>
        /// 价格
        /// </summary>
        public Single Price { get; set; }

        /// <summary>
        /// 成交量
        /// </summary>
        public int Vol { get; set; }
    }

    /// <summary>
    /// 分红除权
    /// </summary>
    public class ExDividend
    {
        /// <summary>
        /// 股票代码
        /// </summary>
        public string StockCode { get; set; }

        /// <summary>
        /// 派息日
        /// </summary>
        public string Date { get; set; }

        /// <summary>
        /// 现金分红额10派x元
        /// </summary>
        public double CashDividend { get; set; }

        /// <summary>
        /// 送股数，10送X股
        /// </summary>
        public double StockDividend { get; set; }

        /// <summary>
        /// 每股现金分红比例
        /// </summary>
        public double CashDividendRate { get; set; }

        /// <summary>
        /// 每股送股比例
        /// </summary>
        public double StockDividendRate { get; set; }
    }


    public class RspStkinfo
    {
        public List<Stkinfo> StkList { get; set; }
    }

    public class RspQuoteRt
    {
        public Dictionary<string, QuoteRt> DicQuoteRt { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspMinTimeData
    {
        public List<MinTimeData> MData { get; set; }
        public string StkCode { get; set; }
        public int Date { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspKLineData
    {
        public List<KLineData> KData { get; set; }
        public string StkCode { get; set; }
        public short Ncount { get; set; }
        public byte KType { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspDetailTransactionData
    {
        public List<Transaction> TData { get; set; }
        public string StkCode { get; set; }
        public int Date { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspDetailOrderData
    {
        public List<Transaction> TData { get; set; }
        public string StkCode { get; set; }
        public int Date { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspTransactionData
    {
        public List<Transaction> TData { get; set; }
        public string StkCode { get; set; }
        public int Date { get; set; }
        public string ErrorMess { get; set; }
    }

    public class RspSendOrder
    {
        public string OrderId { get; set; }
        public string ErrorMess { get; set; }
    }


    public class RspRemoteAccounts
    {
        public List<string> Accounts { get; set; }
        public string ErrorMess { get; set; }
    }


    public class RspCancelOrder
    {
        public string OrderId { get; set; }
        public string ErrorMess { get; set; }
    }
        
    /// <summary>
    /// 实时行情，Redis存储的数据
    /// </summary>
    public struct QuoteRtN
    {
        public UInt16 Market { get; set; }
        public UInt32 StkCode { get; set; }
        public char[] StkName { get; set; }
        public Single Vitality { get; set; }
        public Single LastPrice { get; set; }
        public Single PreClose { get; set; }
        public Single Open { get; set; }
        public Single High { get; set; }
        public Single Low { get; set; }
        /// <summary>
        /// MMddHHmmss 格式，先转字符串，再转DateTime 可处理
        /// </summary>
        public UInt32 Time { get; set; }
        public Single VolAll { get; set; }
        public Single VolNow { get; set; }
        public Single Velocity5Min { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public Single Amount { get; set; }

        /// <summary>
        /// 内盘
        /// </summary>
        public UInt32 Invol { get; set; }

        /// <summary>
        /// 外盘
        /// </summary>
        public UInt32 Outvol { get; set; }

        /// <summary>
        /// 国债利息
        /// </summary>
        /// <summary>
        /// 买1价
        /// </summary>
        public Single Bid1 { get; set; }

        public Single Bid2 { get; set; }
        public Single Bid3 { get; set; }
        public Single Bid4 { get; set; }
        public Single Bid5 { get; set; }

        /// <summary>
        /// 买1量
        /// </summary>
        public Single Bsize1 { get; set; }

        public Single Bsize2 { get; set; }
        public Single Bsize3 { get; set; }
        public Single Bsize4 { get; set; }
        public Single Bsize5 { get; set; }

        /// <summary>
        /// 卖1价
        /// </summary>
        public Single Ask1 { get; set; }

        public Single Ask2 { get; set; }
        public Single Ask3 { get; set; }
        public Single Ask4 { get; set; }
        public Single Ask5 { get; set; }

        public Single Asize1 { get; set; }
        public Single Asize2 { get; set; }
        public Single Asize3 { get; set; }
        public Single Asize4 { get; set; }
        public Single Asize5 { get; set; }
    }
}